﻿<%@ Page Title="Manage Mentor" Language="C#" MasterPageFile="/Administration/Site.Master" AutoEventWireup="true" CodeBehind="AddMentor.aspx.cs" Inherits="AdministrationWeb.Administration.AddMentor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="headerText" runat="server">
    <asp:Label ID="lblTitle" runat="server"></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <table>
        <tr>
            <td>
                First Name:
            </td>
            <td>
                <asp:TextBox ID="TbtFirstName" runat="server" Width="400px" AccessKey="f" /><br/>
                <asp:RequiredFieldValidator ID="firstNameValidator" ControlToValidate="TbtFirstName" runat="server" ErrorMessage="First name cannot be blank."
                    ForeColor="Red" Display="Dynamic" ValidationGroup="1" />
            </td>
        </tr>
        <tr>
            <td>
                Last Name:
            </td>
            <td>
                <asp:TextBox ID="TbtLastName" runat="server" Width="400px" /><br/>
                <asp:RequiredFieldValidator ID="LastNameValidator" ControlToValidate="TbtLastName" runat="server" ErrorMessage="Last name cannot be blank."
                    ForeColor="RED" Display="Dynamic" ValidationGroup="1" />
            </td>
        </tr>
        <tr>
            <td>
                Job Type:
            </td>
            <td>
                <asp:DropDownList ID="DdlJobType" runat="server" DataSourceID="SqlDataJob" DataTextField="job_type_text" DataValueField="job_type_id" />
            </td>
        </tr>
        <tr>
            <td>
                Gender:
            </td>
            <td>
                <asp:DropDownList ID="DdlGender" runat="server" DataTextField="gender" DataValueField="gender">
                    <asp:ListItem />
                    <asp:ListItem Value="M">M</asp:ListItem>
                    <asp:ListItem Value="F">F</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Location:
            </td>
            <td>
                <asp:DropDownList ID="DdlLocation" runat="server" DataSourceID="MySqlLocation" DataTextField="location_text" DataValueField="location_id" />
            </td>
        </tr>
        <tr>
            <td>
                Email:
            </td>
            <td>
                <asp:TextBox ID="TbtEmail" runat="server" Width="400px" /><br/>
                <asp:RegularExpressionValidator ID="RegularExprVEmail" runat="server" ControlToValidate="TbtEmail" ErrorMessage="Please enter a valid Email." ForeColor="Red"
                    ValidationExpression=".*@.*\..*" Display="Dynamic" ValidationGroup="1" />
                <asp:RequiredFieldValidator ID="EmailValidator" ControlToValidate="TbtEmail" runat="server" ErrorMessage="Email cannot be blank." ForeColor="Red" Display="Dynamic"
                    ValidationGroup="1" />
            </td>
        </tr>
        <tr>
            <td>
                Degree:
            </td>
            <td>
                <asp:DropDownList ID="DdlDegree" runat="server" DataSourceID="SqlDataDegree" DataTextField="degree_name" DataValueField="degree_id" />
            </td>
        </tr>
        <tr>
            <td>
                Beneficial Course 1:
            </td>
            <td>
                <asp:DropDownList ID="DdlBenefCourse1" runat="server" DataSourceID="SqlDataBenefCourse1" DataTextField="course_name" DataValueField="course_id" AppendDataBoundItems="True">
                    <asp:ListItem Selected="True" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Beneficial Course 2:
            </td>
            <td>
                <asp:DropDownList ID="DdlBenefCourse2" runat="server" DataSourceID="SqlDataBenefCourse1" DataTextField="course_name" DataValueField="course_id" AppendDataBoundItems="True">
                    <asp:ListItem Selected="True" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Beneficial Course 3:
            </td>
            <td>
                <asp:DropDownList ID="DdlBenefCourse3" runat="server" DataSourceID="SqlDataBenefCourse1" DataTextField="course_name" DataValueField="course_id" AppendDataBoundItems="True">
                    <asp:ListItem Selected="True" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                College:
            </td>
            <td>
                <asp:TextBox ID="TbtCollege" runat="server" Width="400px" />
            </td>
        </tr>
        <tr>
            <td>
                Years Experience:
            </td>
            <td>
                <asp:DropDownList ID="DdlYearsExperience" runat="server" DataSourceID="MySqlYrsExper" DataTextField="range_text" DataValueField="range_id" />
            </td>
        </tr>
        <tr>
            <td>
                Area of Focus:
            </td>
            <td>
                <asp:DropDownList ID="ddlFocus" runat="server" DataSourceID="SqlFocus" DataTextField="focus_name" DataValueField="focus_id" AutoPostBack="True" 
                    onselectedindexchanged="ddlFocus_SelectedIndexChanged" />
            </td>
        </tr>
        <tr>
            <td>
                Pathway:
            </td>
            <td>
                <asp:DropDownList ID="ddlPathway" runat="server" DataSourceID="SqlPathway" DataTextField="pathway_name" DataValueField="pathway_id" />
            </td>
        </tr>
        <tr>
            <td>
                Photo:
            </td>
            <td>
                <asp:FileUpload ID="ImageUploader" runat="server" Width="400" />.jpg Less than 1 MB (1000 kb)
                <asp:CustomValidator ID="UpdateImageValidation" runat="server" 
                    SetFocusOnError="true" ControlToValidate="ImageUploader" ErrorMessage="must upload a jpg image file type &lt; 1 MB"
                    ForeColor="Red" Font-Size="X-Small" Display="Dynamic" 
                    OnServerValidate="UpdateImageValidation_ServerValidate" ValidationGroup="1" />                
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Image ID="imgMentorFace" runat="server" Height="175px" Width="175px" />
            </td>
        </tr>
        <tr>
            <td>
                Additional Comments:
            </td>
            <td>
                <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Width="350px" Height="120px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="submitButtons">
                <asp:Button ID="BtnSave" runat="server" Text="Submit" OnClick="BtnSave_Click" ValidationGroup="1" CssClass="button" />
                <asp:Button ID="BtnCancel" runat="server" Text="Cancel" OnClick="BtnCancel_Click" CssClass="button" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Label ID="lblMentorId" runat="server" Visible="False"></asp:Label>
                <asp:Label ID="LblResult" runat="server" ForeColor="#3333FF"></asp:Label>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlInsert" runat="server" />
    <asp:SqlDataSource ID="SqlDataJob" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT lkup_job_type.* FROM lkup_job_type" />
    <asp:SqlDataSource ID="MySqlLocation" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT lkup_location.* FROM lkup_location" />
    <asp:SqlDataSource ID="SqlDataDegree" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT lkup_degree.* FROM lkup_degree" />
    <asp:SqlDataSource ID="SqlDataBenefCourse1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT lkup_courses.* FROM lkup_courses ORDER BY course_name" />
    <asp:SqlDataSource ID="MySqlYrsExper" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT lkup_year_range.* FROM lkup_year_range" />
    <asp:SqlDataSource ID="SqlFocus" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT DISTINCT lkup_focus_area.focus_name, lkup_focus_area.focus_id FROM lkup_focus_area ORDER BY focus_name" />
    <asp:SqlDataSource ID="SqlPathway" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString %>" ProviderName="<%$ ConnectionStrings:ApplicationConnectionString.ProviderName %>"
        SelectCommand="SELECT lkup_pathway.pathway_id, lkup_pathway.pathway_name FROM lkup_pathway ORDER BY pathway_name" />
</asp:Content>
